﻿@model IEnumerable<MegaBitProject.Models.Application>
@{
    ViewBag.Title = "Home";
}
@section featured {
    <section class="featured">
        <div class="content-wrapper">
            <hgroup class="title"></hgroup>
        </div>
    </section>
}
<div id="main">
    @foreach(var game in Model)
    {
        <div class="game">
            <h2>@game.name</h2>
            @if (User.Identity.IsAuthenticated)
            {
                <a href="@Url.Action(game.view, game.controller)"><img class="gamepic" src="/Content/SitePics/@game.picture" alt="@game.name" /></a>
                @Html.ActionLink("Click here to play", game.view, game.controller, null, new { @class = "game-link" });
            }
            else
            {
                <a href="@Url.Action("LogIn", "Account")"><img class="gamepic" src="/Content/SitePics/@game.picture" alt="@game.name" /></a>
                @Html.ActionLink("Click here to play", "LogIn", "Account", null,  new { @class = "game-link" });
            }
        </div>
    }
    @Html.Action("_Highscore", "Home")
    @Html.Action("_CurrentGames", "Home")
</div>
